{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "Mandate Revisions Load Response",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "interfaceCategory" : {
      "type" : "string",
      "enum" : [ "Payments" ],
      "description" : "CMP categorisation of the job associated with this file"
    },
    "interfaceType" : {
      "type" : "string",
      "enum" : [ "Mandates" ],
      "description" : "Sub-categorisation of the job"
    },
    "version" : {
      "type" : "number",
      "minimum" : 0.0,
      "maximum" : 99.99,
      "description" : "The current version of the generic extract file. This must match the corresponding outbound file."
    },
    "transformDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Indicates when a third-party file was transformed into the format required by CMP"
    },
    "transmitDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Indicates when a file was sent to or received from a third-party system"
    },
    "details" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/MandateRevisionsLoadResponseDetail"
      }
    },
    "externalFileName" : {
      "type" : "string",
      "pattern" : "^([a-zA-Z0-9._-])+$",
      "maxLength" : 100,
      "description" : "Third party file name"
    }
  },
  "required" : [ "interfaceCategory", "interfaceType", "version", "externalFileName" ],
  "definitions" : {
    "MandateRevisionsLoadResponseDetail" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "hierarchyEntity" : {
          "$ref" : "#/definitions/HierarchyEntity",
          "description" : "Represents the customer hierarchy the mandate is referring to. Mandates only applicable at account"
        },
        "mandateRevisionCode" : {
          "type" : "string",
          "maxLength" : 10,
          "description" : "Code to indicate the nature of the mandate revision"
        },
        "transactionSummary" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "Short description of the transaction e.g. may contain an external error description"
        },
        "transactionDetail" : {
          "type" : "string",
          "maxLength" : 100,
          "description" : "Longer description of the transaction e.g. may contain additional error detail"
        },
        "mandateReference" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "Reference of the mandate that is to be amended or cancelled"
        },
        "bankIdentifier" : {
          "type" : "string",
          "maxLength" : 20,
          "description" : "Bank Identifier"
        },
        "bankAccountIdentifier" : {
          "type" : "string",
          "maxLength" : 40,
          "description" : "Bank Account Identifier"
        },
        "nameOfPayer" : {
          "type" : "string",
          "maxLength" : 50,
          "description" : "Name Of Payer"
        }
      },
      "required" : [ "hierarchyEntity", "mandateRevisionCode", "mandateReference" ]
    },
    "HierarchyEntity" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "accountId" : {
          "type" : "integer",
          "description" : "The account number associated with the mandate"
        }
      }
    }
  }
}